home *** CD-ROM | disk | FTP | other *** search
/ Skunkware 5 / Skunkware 5.iso / src / Games / flying-6.11 / sccs / s.global.h next >
Encoding:
Text File  |  1995-06-30  |  6.0 KB  |  227 lines

  1. h23279
  2. s 00007/00001/00199
  3. d D 1.2 95/06/29 13:36:29 tom 2 1
  4. c Skunkware port
  5. e
  6. s 00200/00000/00000
  7. d D 1.1 95/05/08 19:41:43 tom 1 0
  8. c date and time created 95/05/08 19:41:43 by tom
  9. e
  10. u
  11. U
  12. t
  13. T
  14. I 1
  15. #ifndef    _global_h
  16. #define    _global_h
  17.  
  18. // Directory, in which to put the bitmap files for deluxe-playing
  19. D 2
  20. #define    DATA_DIRECTORY        "fly.dta"
  21. E 2
  22. I 2
  23. #ifdef ANCILLA
  24. #define    DATA_DIRECTORY        "/u/games/lib/flying-6.11/fly.dta"
  25. #endif
  26.  
  27. #ifdef SKUNKWARE
  28. #define    DATA_DIRECTORY        "/usr/skunk/lib/flying-6.11/fly.dta"
  29. #endif
  30. E 2
  31.  
  32. // name of the file to look for static data of the classes
  33. #define    PRESET_FILE            "presets.txt"
  34.  
  35. #define    LOG_FILE                DATA_DIRECTORY"/logfile.txt"
  36.  
  37. //
  38. // As an optimization, every DynObj gets a storage for caching the calculated
  39. // collision-times with other objects. At the moment of a collision, only
  40. // the 2 objects taking part in the collision have to update their cache
  41. // and probably inform other objects about their changes.
  42. #define    TIME_CACHE        1
  43.  
  44. //
  45. // The collision detection can be aborted at an early stage, when a minimum
  46. // time can be estimated which lies beyond a limit.
  47. // Problem: - The check, if to abort, already takes too much time.
  48. //          - When time-caching is on, advanced collision times, which aren't
  49. //            of any use at the moment of calculation, might be used later on.
  50. #define    ABORT_CALC        0
  51. #if (ABORT_CALC)
  52. #    define    ABORT_CALC_WALL    0
  53. #    define    ABORT_CALC_BALL    0
  54. #endif
  55.  
  56. //
  57. // The basic floating point class can be exchanged between doubles and
  58. // floats. The latter one is faster on my 386.
  59. #ifndef __TURBOC__
  60. #    define    REAL_IS_FLOAT    0
  61. #else
  62. #    define    REAL_IS_FLOAT    1
  63. #endif
  64.  
  65. //
  66. // A real C++-Class can be used for real arithmetic. Unfortunately
  67. // that really slows the calculation down, even though the whole class
  68. // is defined inline.
  69. #define    REAL_IS_CLASS    0
  70.  
  71. //
  72. // There are some specialized vector classes for 2 and 3 dimensional
  73. // vectors, which can also be realized by inheriting from an universal
  74. // vector-class (but again, that's expensive)
  75. #define    Vec2IsVector    0
  76. #define    Vec3IsVector    0
  77.  
  78. //
  79. // Switch to pre-existing (better to understand) algorithms for
  80. // collision detection, instead of the special algortithm (which is
  81. // a bit faster).
  82. #define    EasyWall        0
  83.  
  84. //
  85. // special constants instead of the collision time
  86. #define    MAX_TIME                1e10
  87. #define    NO_HIT                MAX_TIME
  88. #define    NO_TARGET            MAX_TIME
  89. #define    RUNNING_LOSE        4e10
  90. #if (ABORT_CALC)
  91. #    define    NOT_REACHABLE    2e10
  92. #endif
  93.  
  94. //
  95. // constants to overcome the problem with unprecise real-arithmetics
  96. #if (REAL_IS_FLOAT)
  97. #    define    EPS             1e-4
  98. #else
  99. #    define    EPS             1e-10
  100. #endif
  101.  
  102. //
  103. // current time in calculation
  104. // not to mix up with the realtime of GetCurrentTime()
  105. //
  106. extern double    current_time;
  107.  
  108. #ifndef __TURBOC__
  109. #    define    _DEBUG
  110. #endif
  111. //
  112. // debugging switches, the main switch DEBUG enables all successive
  113. // options, mainly leading to traces on stdout
  114. #ifdef DEBUG
  115.  
  116. #include <stdio.h>
  117. #include <stdlib.h>
  118. #include <string.h>
  119.  
  120. extern long        debug;                // Variable der anzuzeigenden modes
  121. #define    ShowLight            0x00000001l
  122. #define    ShowColors            0x00000002l
  123. #define    ShowRings            0x00000004l
  124. #define    ObjectInfo            0x00000008l
  125. #define    BeforCollision        0x00000010l
  126. #define    AfterCollision        0x00000020l
  127. #define    CheckBoundary        0x00000040l
  128. #define    MoveAll                0x00000080l
  129. #define    __Moves                0x000000f8l
  130. #define    PBallHit                0x00000100l
  131. #define    PointerMove            0x00000200l
  132. #define    XWallHit          0x00000400l
  133. #define    YWallHit                0x00000800l
  134. #define    CollCalc                0x00001000l
  135. #define    AbortCalc            0x00002000l
  136. #define    AbortReCalc            0x00004000l
  137. #define    StickLevel            0x00008000l
  138. #define    GameState            0x00010000l
  139. #define    BMover                0x00020000l
  140. #define    BState                0x00040000l
  141. #define    Sync                    0x00080000l
  142. #define    ShowTurns            0x00100000l
  143. #define    Loops                    0x00200000l
  144. #define    __ShowAll            0x00100007l
  145. #define    __Rings                0x00100004l
  146. #define    Intro                    0x00400000l
  147. #define    xdb               0x00800000l
  148. #define    xwd               0x02000000l
  149. #define  ForceCalc         0x01000000l
  150. #define  Motion                0x04000000l
  151.  
  152. #define    TCTrace                0x40000000l
  153. #define    UnixTrace            0x80000000l
  154.  
  155. #define    ShowSubWindow        (ShowLight|ShowColors|ShowRings|ShowTurns)
  156.  
  157. #define    DBG0(m,f)            if (debug&m)    printf( f )
  158. #define    DBG1(m,f,a)            if (debug&m)    printf( f,a )
  159. #define    DBG2(m,f,a,b)        if (debug&m)    printf( f,a,b )
  160. #define    DBG3(m,f,a,b,c)    if (debug&m)    printf( f,a,b,c )
  161. #define    DBG4(m,f,a,b,c,d)    if (debug&m)    printf( f,a,b,c,d )
  162.  
  163. int set_debug( const char *flag_name );
  164. void show_flags();
  165.  
  166. #else
  167.  
  168. #define    DBG0(m,f)
  169. #define    DBG1(m,f,a)
  170. #define    DBG2(m,f,a,b)
  171. #define    DBG3(m,f,a,b,c)
  172. #define    DBG4(m,f,a,b,c,d)
  173.  
  174. #endif
  175.  
  176. #include "stdinc.h"
  177.  
  178. //
  179. // Fⁿr Zeitmessungen kann das Zeichnen der sich bewegenden BΣlle komplett
  180. // unterdrⁿckt werden, indem die DrawCircle()-Funktion durch eine leere
  181. // Funktion ersetzt wird.
  182. #define    STATISTICS
  183. #define    _NO_DRAW
  184.  
  185. //
  186. // Reibungsimplementierung, in dem schrittweise
  187. // die Geschwindigkeit verkleinert wird. Das Problem ist allerdings, das mit
  188. // jedem Schritt die Zeiten des TIME-CACHE ungⁿltig werden, und daher
  189. // nicht zu viele Schritte pro Sekunden eingelegt werden sollten.
  190. // Die Parametrierung der Reibung und der Aufl÷sung der Schrittberechnung
  191. // geschieht durch virtuelle Funktionen der Game-Klasse
  192. //
  193. // Einschalten der Reibungssimulation durch stufige Verlangsamung:
  194. #define SIM_SLOW                1
  195.  
  196. #if (SIM_SLOW)
  197. #    define    SUPPRESS_SLOWSTEP        -1.0
  198. #endif
  199.  
  200.  
  201. // ===========================================================================
  202. //   'Wissenswertes' aus verschiedenen Bereichen (reduziert AbhΣngigkeiten)
  203. // ===========================================================================
  204.  
  205. extern double w2n;                    // Fensterskalierung                (graph.C)
  206.  
  207. typedef long ColorId;
  208.  
  209.  
  210. #define    SOUND_SUBSYSTEM    1
  211. #if (SOUND_SUBSYSTEM)
  212. extern    int sound_request;    // sound einschalten                            (main.C)
  213. #endif
  214. extern    int size;                // gewⁿnschte (aktuelle) Fenstergr÷▀e    (main.C)
  215. extern    int deluxe;                // Luxus-Flag                          (main.C)
  216. extern    int light_flag;        // Light-Sources                                (main.C)
  217. extern    int color_flag;        // table color                                    (main.C)
  218. extern    int nohint_flag;        // aiming hint                                    (main.C)
  219. #define    ON_ROOT        -1
  220.  
  221.  
  222. void show_defaults();
  223. void load_konfi();
  224.  
  225. #endif
  226. E 1
  227.